package etnorservice.etnor_service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import etnorservice.etnor_service.domain.*;
import etnorservice.etnor_service.domain.dto.ProblemDTO;
import etnorservice.etnor_service.domain.dto.UserDTO;
import etnorservice.etnor_service.domain.po.*;
import etnorservice.etnor_service.domain.vo.DeveloperVO;
import etnorservice.etnor_service.request.ProblemSearchRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: cc
 * @Date: 2024/08/22/15:00
 **/
@Mapper
public interface UserMapper extends BaseMapper<UserDomain> {
    List<User> findUserByAccountAndPassword(User user);
    User findRoleByAccount(@Param("account") Integer account);
    List<UserDTO> findSuperAdmin();
    List<ProblemDTO> findProblemKinds();
    int insertProblem(ProblemDO problemDO);
    List<ProblemDO> findProblemByTalentId(@Param("talentId") Integer talentId);
    int cancelProblem(@Param("problemid") String problemid);
    List<Problem> findProblemList();
    List<Developer> findAllDevelopers();
    DeveloperVO findDeveloperById(@Param("id") Integer id);
    Developer findDeveloperByTalentId(@Param("talentId") String talentId);
    UserDetails findUserDetailsByAccount(@Param("account") String account);
    List<ProblemDO> findProblemsByConditions(
            ProblemSearchRequest problemSearchRequest);
    List<MenuItem> findUserPermissions(@Param("userId") Integer userId);

    Integer findAllUsers();



    List<RoleDomain> getUserRoles(Integer userId);
    List<MenuItemDomain> getUserMenus(Integer userId);
    List<RoleUserDomain> getAllRoles();

    void registerUser(LoginAndRegister loginAndRegister);


    List<User> findUserByEmail(@Param("email") String email);

}
